<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WaterMyStorage extends Model
{
   use \App\Models\Traits\ScopeCompanySite;
   use \App\Models\Traits\Site;
   
   protected $fillable = [ 'num', 'shop_status', 'shop_id', 'company_id', 'site_id' ];
   
    public function getCompanyField() {
        return 'company_id';
    }
    
    public function getSiteField() {
        return 'site_id';
    }
    
    //项目信息
    public function companies() {
        return $this->hasOne('App\Models\Company', "Co_ID", "company_id");
    }
    //站点
    public function sites() {
        return $this->hasOne('App\Models\Site', "id", "site_id");
    }
    
     //商品
    public function shop() {
        return $this->hasOne('App\Models\WaterShop', "id", "shop_id");
    }
    
}
